package net.zjitc.service.Product.impl;

import net.zjitc.damain.Product.Product;
import net.zjitc.damain.category.Category;
import net.zjitc.dao.Product.ProductDao;
import net.zjitc.service.Product.ProductService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by 95729 on 2017/3/21.
 */
@Service
@Transactional
public class ProductServiceImpl implements ProductService {
    @Resource
    private ProductDao productDao;
    @Override
    public List<Product> findAll() {
        return productDao.findAll();
    }

    @Override
    public Product findById(Integer pid) {
        return productDao.findById(pid);
    }

    @Override
    public void Delete(Product product) {
        productDao.Delete(product);
    }



    @Override
    public void edit(Category model) {
        productDao.edit(model);
    }

    @Override
    public void save(Product model) {
        productDao.save(model);
    }

    @Override
    public List<Product> findHotProductu(int i) {
        return productDao.findHotProductu(i);
    }

    @Override
    public List<Product> findNewProductu(int i) {
        return productDao.findNewProductu(i);
    }
}
